package com.ruoyi.framework.websocket;

import com.alibaba.fastjson2.JSON;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.system.domain.SysNotice;
import com.ruoyi.system.service.ISysNoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.websocket.Session;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

@Component("noticeTask")
public class noticeMessage {
    @Autowired
    private ISysNoticeService iSysNoticeService;

    public void sendMessage(SysNotice notice)
    {
        try {
            WebSocketUsers.sendMessage(notice);
        } catch (Exception e) {
            System.out.println("sendMessage 执行异常");
        }
    }
}
